import request from '@/utils/request'

export function fetchUserCount(params) {
  return request({
    url: '/user/count',
    method: 'get',
    params: params
  })
}

export function fetchAmount(params) {
  return request({
    url: '/order/getAmount',
    method: 'get',
    params: params
  })
}

export function fetchReportAmount(params) {
  return request({
    url: '/order/getReportAmount',
    method: 'get',
    params: params
  })
}

export function fetchList(params) {
  return request({
    url: '/order/list',
    method: 'get',
    params: params
  })
}

export function fetchMobileList(params) {
  return request({
    url: '/order/mobile-list',
    method: 'get',
    params: params
  })
}

export function closeOrder(params) {
  return request({
    url: '/order/update/close',
    method: 'post',
    params: params
  })
}

export function deleteOrder(params) {
  return request({
    url: '/order/delete',
    method: 'post',
    params: params
  })
}

export function deliveryOrder(data) {
  return request({
    url: '/order/update/delivery',
    method: 'post',
    data: data
  });
}

export function getOrderDetail(id) {
  return request({
    url: '/order/' + id,
    method: 'get'
  });
}

export function updateReceiverInfo(data) {
  return request({
    url: '/order/update/receiverInfo',
    method: 'post',
    data: data
  });
}

export function updateMoneyInfo(data) {
  return request({
    url: '/order/update/moneyInfo',
    method: 'post',
    data: data
  });
}

export function updateOrderNote(params) {
  return request({
    url: '/order/update/note',
    method: 'post',
    params: params
  })
}
